
<!DOCTYPE html>
<html lang="en-us">
    <include file="Common/Common/head" />  
    <style type="text/css">
        /*分页格式开始*/
        #dt_basic_wrapper div:nth-child(2){ text-align: center;}
        .current{ padding: 10px 10px 10px 10px; border:1px solid #AFAFAF; background-color: #CCCCCC;}
        .num{ padding: 10px 10px 10px 10px; border:1px solid #AFAFAF;}
        .rows{ margin-top: 20px;}
        /*分页格式结束*/
    </style>
    <body class="desktop-detected pace-done smart-style-3">
    <include file="Common/Common/header" />
    <include file="Widget/Common/navigation" />

    <!-- #MAIN PANEL -->
    <div id="main" role="main">

        <!-- RIBBON -->
        <div id="ribbon">

            <!-- breadcrumb -->
            <ol class="breadcrumb">
                <li>{$module_name}</li>

            </ol>
            <!-- end breadcrumb -->

            <!-- You can also add more buttons to the
            ribbon for further usability

            Example below:

            <span class="ribbon-button-alignment pull-right" style="margin-right:25px">
                    <a href="#" id="search" class="btn btn-ribbon hidden-xs" data-title="search"><i class="fa fa-grid"></i> Change Grid</a>
                    <span id="add" class="btn btn-ribbon hidden-xs" data-title="add"><i class="fa fa-plus"></i> Add</span>
                    <button id="search" class="btn btn-ribbon" data-title="search"><i class="fa fa-search"></i> <span class="hidden-mobile">Search</span></button>
            </span> -->

        </div>
        <!-- END RIBBON -->

        <!-- #MAIN CONTENT -->



        <div id="content">
            <div class="row">
                <div class="col-xs-12 col-sm-7 col-md-7 col-lg-4">
                    <h1 class="page-title txt-color-blueDark">

                        <!-- PAGE HEADER -->
                        <i class="fa-fw fa fa-home"></i> 
                        {$first_title}
                        <span>>  
                            {$second_title}
                        </span>
                    </h1>
                </div>

            </div>

            <!-- widget grid -->
            <section id="widget-grid" class="">

                <!-- row -->
                <div class="row">

                    <!-- NEW WIDGET START -->
                    <article class="col-xs-12 col-sm-12 col-md-12 col-lg-12 sortable-grid ui-sortable">
                        <!-- toolbar -->
                        <div id="toolbar" class="btn-group pull-left">
                            <a class="btn btn-default btn-flat" href="{:U('topic_add')}"><i class="fa fa-plus fa-fw"></i>添加专题</a>
                        </div>
                        <table id="bootstrapTable" class="table bootstrapTable">
                        </table> 


                    </article>
                    <!-- WIDGET END -->

                </div>

                <!-- end row -->

                <!-- end row -->

            </section>
            <!-- end widget grid -->

        </div>



        <!-- end row -->

        <!-- END #MAIN CONTENT -->

    </div>
    <div id="addtab" title="会员详情">

        <form id='member_view_dialog'>

            <fieldset>
                <input name="authenticity_token" type="hidden">
                <div class="form-group">
                    <label>用户版本</label>
                    <input class="form-control" id="versions" placeholder="" type="text" name="versions" readonly='readonly'>
                </div>
                <div class="form-group">
                    <label>切换版本</label>
                    <input type="radio" value="1" name="version_code" id="version_code1"> <label for="version_code1">学习版</label> <input type="radio" value="2" name="version_code" id="version_code2"> <label for="version_code2">普通版</label>
                </div>
                <input type="hidden" name="mid" id='mid' value="" />

            </fieldset>

        </form>

    </div>
    <!-- END #MAIN PANEL -->

    <!-- #PAGE FOOTER -->

    <!-- END FOOTER -->
    <include file="Common/Common/footer" />

    <script src="{$resource_path}js/app.config.js"></script>
    <script src="{$resource_path}js/plugin/jquery-touch/jquery.ui.touch-punch.min.js"></script> 
    <script src="{$resource_path}js/smartwidgets/jarvis.widget.min.js"></script>
    <script src="{$resource_path}js/plugin/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="{$resource_path}js/plugin/bootstrap-table/extensions/cookie/bootstrap-table-cookie.min.js"></script>
    <script src="{$resource_path}js/plugin/bootstrap-table/extensions/export/tableExport.min.js"></script>
    <script src="{$resource_path}js/plugin/bootstrap-table/extensions/export/bootstrap-table-export.min.js"></script>
    <script src="{$resource_path}js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script type="text/javascript">
        $(function () {
            //表格数据  文档参考 http://bootstrap-table.wenzhixin.net.cn/documentation/
            $('#bootstrapTable').bootstrapTable({
                url: "{:U('topics')}",
                pagination: true,
                pageList: [10, 20, 50, 100, 'All'],
                pageSize: 10,
                pageNumber: 1,
                search: true,
                sortable: true,
                idField: "id",
                sortOrder: "DESC",
                showRefresh: true,
                showExport: true,
                showColumns: true,
                clickToSelect: true,
                columns: [{
                        field: 'vid',
                        title: '编号'
                    }, {
                        field: 'vtitle',
                        title: '主题'
                    }, {
                        field: 'vtop_img',
                        title: '图片',
                        formatter: function(value, row, index) {
                          if (row.vtop_img) {
                            return "<img src='"+row.vtop_img+"' style='height:100px'/>";
                          }
                        }
                    }, {
                        field: 'btime',
                        title: 'btime'
                    }, {
                        field: 'etime',
                        title: 'etime'
                    }, {
                        field: 'remarks',
                        title: 'remarks'
                    },  {
                        field: 'pcounts',
                        title: '产品数量'
                    }, {
                        field: 'vcounts',
                        title: '投票总数'
                    }, {
                        field: 'turnout',
                        title: '参与人数'
                    },{
                        field: 'id,ctime',
                        title: '操作',
                        formatter: function (value, row, index) {
                            var d = '<a class="btn btn-xs btn-default" href="{:U("topic_modify")}?vid=' + row.vid + '" title="编辑"><i class="fa fa-pencil"></i></a> ';
                            
                            return d;
                        }
                    }

                ]
            });
        });

        // DO NOT REMOVE : GLOBAL FUNCTIONS!

        $(document).ready(function () {

            pageSetUp();



            /* END BASIC */



            // custom toolbar
            $("div.toolbar").html('<div class="text-right"><img src="img/logo.png" alt="SmartAdmin" style="width: 111px; margin-top: 3px; margin-right: 10px;"></div>');
        })






    </script>

</html>